package com.bicon.bdata_service_search.es.service.Impl;

import com.bicon.bdata_service_search.es.entities.AccountInfo;
import com.bicon.bdata_service_search.es.repository.ElasticAccountInfoRepository;
import com.bicon.bdata_service_search.es.service.ESAccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * 描述:
 * service Impl
 *
 * @author zhaoyu
 * @email zhaoyu@vv.cc
 * @create 2018-08-23 10:08
 */
@Service("esAccountInfoServiceImpl")
public class ESAccountInfoServiceImpl implements ESAccountInfoService {

    @Autowired
    private ElasticAccountInfoRepository elasticAccountInfoRepository;

//    public AccountInfo queryAccountInfoById(String id) {
//        return elasticAccountInfoRepository.findOne(id);
//    }

    @Override
    public AccountInfo queryAccountInfoByName(String accountName) {
        return elasticAccountInfoRepository.findByAccountName(accountName);
    }

    @Override
    public Page<AccountInfo> findAllPage(int pageNumber,int pageSize) {
        return elasticAccountInfoRepository.findAll();
    }

    @Override
    public Page<AccountInfo> findAll() {
        return elasticAccountInfoRepository.findAll();
    }

}